fix: six small issues found during the sync/async parity review#1256
Open
AhmadMasry wants to merge 1 commit into
Open
fix: six small issues found during the sync/async parity review#1256AhmadMasry wants to merge 1 commit into
AhmadMasry wants to merge 1 commit into
Conversation
- Blue/Green: add the two message keys referenced by logger calls (SuspendConnectRouting.WaitConnectUntilCorrespondingHostFound is logged WITH a format arg, so its absence raised NotInResourceBundleError whenever DEBUG logging was enabled during a switchover; BlueGreenStatusProvider.AllGreenHostsChangedName was silently skipped). - Limitless: _is_login_exception now returns the classification verdict (previously discarded, so login failures were never short-circuited out of the router retry loop as the callers intend); the synchronous get-routers path queries the freshly reconnected monitoring connection instead of the stale pre-reconnect local. - Session state: reset_transfer_session_state_on_switch_func assigned a nonexistent attribute, silently keeping the old transfer handler registered -- it now clears the real one. - Plugin service: the CouldNotDetermineCurrentHost error resolves its message key instead of raising the raw key string. - Aurora initial connection strategy: the retry deadline now comes from open_connection_retry_timeout_ms (previously it reused open_connection_retry_interval_ms and never read the timeout property). Each fix has a focused regression test.
cf3a6e1 to
a980224
Compare
Open
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While preparing the async (asyncio) phase of #1251, we ran a systematic sync/async parity review — comparing each module of the upcoming async port against its sync counterpart line by line, with the sync implementation as the source of truth. Along the way the review surfaced a handful of small pre-existing issues in the sync code. This PR fixes the six of them we could verify, each with a focused regression test. They are all small and independent; happy to split or drop any of them if you'd prefer.
SuspendConnectRouting.WaitConnectUntilCorrespondingHostFoundis logged with a format argument (blue_green_plugin.py:504);Logger.debug's formatted path has no missing-key guard, so with DEBUG logging enabled a switchover in the suspend-until-corresponding-host path raisesNotInResourceBundleError.BlueGreenStatusProvider.AllGreenHostsChangedName(no-arg,:1791) was silently skipped. Both keys are added._is_login_exceptiondiscarded its result (limitless_plugin.py:524-525had noreturn), so theif self._is_login_exception(e): raiseguards in the connect/retry paths never fired and login failures were retried like transient errors. It now returns the classification verdict. Note: this is a small behavior change — auth failures now surface immediately instead of burning the router retry budget, which appears to be the callers' intent.context.set_connection(...)replaces a dead/None monitoring connection, the router query still used the pre-reconnect local variable (:505-510). It now queries the fresh connection.reset_transfer_session_state_on_switch_funcassigned a nonexistent attribute (states/session_state_service.py:99-101—reset_transfer_session_state_on_switch_callableinstead oftransfer_session_state_on_switch_callable), so a registered custom transfer handler could never be cleared.plugin_service.py:475raised the literal string"PluginServiceImpl.CouldNotDetermineCurrentHost"instead of the resolved message (the key exists in the bundle)._get_verified_writer_connectionand_get_verified_reader_connectioncomputed the deadline fromOPEN_CONNECTION_RETRY_INTERVAL_MS(default 1 s), andOPEN_CONNECTION_RETRY_TIMEOUT_MS(default 30 s) was never read anywhere — effectively capping the whole retry budget at one interval. The deadline now uses the timeout property.The five limitless retry tests were updated to stub
is_login_exceptionasFalse(they exercise generic retryable errors — previously the discarded verdict masked the distinction).Verification:
mypy(237 files),flake8,isort, andpytest ./tests/unit -Werror(1,123 passed) all clean.Proposed CHANGELOG entry (under
### :bug: Fixed):By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.